/* Scenario code for LOCKJAW, an implementation of the Soviet Mind Game

Copyright (C) 2008 Damian Yerrick <tepples+lj@spamcop.net>

This work is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

Original game concept and design by Alexey Pajitnov.
The Software is not sponsored or endorsed by Alexey Pajitnov, Elorg,
or The Tetris Company LLC.

*/

package fizzpicks.tetrapulp.tetrapulp;

import java.util.Map;
import java.util.EnumMap;
import java.util.Iterator;

/**
 * Created by will
 * Date: May 4, 2008 3:03:59 AM
 */
public class Scenario {
    public static Preset[] predefPresets = {
            new Preset("Guideline",
        Options.WIDTH, 10,
        Options.HEIGHT, 20,
        Options.ENTRY_DELAY, 0,
        Options.PIECE_SET, LJRAND2._4BLK,
        Options.RANDOMIZER, LJRAND.BAG,
        Options.HOLD_PIECE, LJHOLD.EMPTY,
        Options.ROTATION_SYSTEM, LJROT.SRS,
        Options.FLOOR_KICKS, 6,
        Options.LOCKDOWN, LJLOCK.MOVE,
        Options.LOCK_DELAY, 30,
        Options.BOTTOM_BLOCKS, 0,
        Options.LINE_DELAY, 30,
        Options.CLEAR_GRAVITY, LJGRAV.NAIVE,
        Options.GLUING, LJGLUING.NONE,
        Options.SCORING, LJSCORE.TDS,
        Options.DROP_SCORING, LJDROP._1S_2H,
        Options.T_SPIN, LJTS.TDS),

            new Preset("Classic",
        Options.GIMMICK, LJGM.ATYPE,
        Options.WIDTH, 10,
        Options.HEIGHT, 20,
        Options.ENTER_ABOVE, false,
        Options.ENTRY_DELAY, 10,
        Options.SPEED_CURVE, LJSPD.NES,
        Options.PIECE_SET, LJRAND2._4BLK,
        Options.RANDOMIZER, LJRAND.PURE,
        Options.HOLD_PIECE, LJHOLD.NONE,
        Options.ROTATION_SYSTEM, LJROT.NES,
        Options.FLOOR_KICKS, 0,
        Options.LOCKDOWN, LJLOCK.NOW,
        Options.LOCK_DELAY, 0,
        Options.BOTTOM_BLOCKS, 0,
        Options.LINE_DELAY, 30,
        Options.CLEAR_GRAVITY, LJGRAV.NAIVE,
        Options.GLUING, LJGLUING.NONE,
        Options.SCORING, LJSCORE.NES,
        Options.DROP_SCORING, LJDROP.NES,
        Options.GARBAGE, LJGARBAGE.NONE,
        Options.SIDEWAYS_DELAY, 15,
        Options.SIDEWAYS_SPEED, 6,
        Options.SOFT_DROP_SPEED, 2,
        Options.INITIAL_SIDEWAYS, 1,
        Options.IRS, 0,
        Options.NEXT_PIECES, 1),

      /* http://www.tetrisconcept.com/forum/viewtopic.php?t=892 */
      new Preset("Master",
        Options.GIMMICK, LJGM.ATYPE,
        Options.WIDTH, 10,
        Options.HEIGHT, 20,
        Options.ENTER_ABOVE, false,
        Options.SPEED_CURVE, LJSPD.TGM,
        Options.ENTRY_DELAY, 30,
        Options.PIECE_SET, LJRAND2._4BLK,
        Options.RANDOMIZER, LJRAND.HIST_6,
        Options.HOLD_PIECE, LJHOLD.NONE,
        Options.ROTATION_SYSTEM, LJROT.ARIKA,
        Options.FLOOR_KICKS, 0,
        Options.LOCKDOWN, LJLOCK.STEP,
        Options.LOCK_DELAY, 30,
        Options.BOTTOM_BLOCKS, 0,
        Options.LINE_DELAY, 0,
        Options.CLEAR_GRAVITY, LJGRAV.NAIVE,
        Options.GLUING, LJGLUING.STICKY,
        Options.GARBAGE, LJGARBAGE.NONE,
        Options.SIDEWAYS_DELAY, 16,
        Options.SIDEWAYS_SPEED, 1,
        Options.INITIAL_SIDEWAYS, 0,
        Options.IRS, 1,
        Options.SOFT_DROP_SPEED, 1,
        Options.SOFT_DROP, LJZANGI.LOCK,
        Options.HARD_DROP, LJZANGI.SLIDE,
        Options.NEXT_PIECES, 1),

      /* http://www.tetrisconcept.com/forum/viewtopic.php?t=892 */
      new Preset("T.A. Death",
        Options.GIMMICK, LJGM.ATYPE,
        Options.SPEED_CURVE, LJSPD.DEATH,
        Options.WIDTH, 10,
        Options.HEIGHT, 20,
        Options.ENTER_ABOVE, false,
        Options.ENTRY_DELAY, 30,
        Options.PIECE_SET, LJRAND2._4BLK,
        Options.RANDOMIZER, LJRAND.HIST_6,
        Options.HOLD_PIECE, LJHOLD.NONE,
        Options.ROTATION_SYSTEM, LJROT.ARIKA,
        Options.FLOOR_KICKS, 0,
        Options.LOCKDOWN, LJLOCK.STEP,
        Options.LOCK_DELAY, 30,
        Options.BOTTOM_BLOCKS, 0,
        Options.LINE_DELAY, 0,
        Options.CLEAR_GRAVITY, LJGRAV.NAIVE,
        Options.GLUING, LJGLUING.STICKY,
        Options.GARBAGE, LJGARBAGE.NONE,
        Options.SIDEWAYS_DELAY, 16,
        Options.SIDEWAYS_SPEED, 1,
        Options.INITIAL_SIDEWAYS, 0,
        Options.IRS, 1,
        Options.NEXT_PIECES, 1),

      new Preset("Square",
        Options.GIMMICK, LJGM.ATYPE,
        Options.WIDTH, 10,
        Options.HEIGHT, 20,
        Options.ENTER_ABOVE, true,
        Options.ENTRY_DELAY, 30,
        Options.SPEED_CURVE, LJSPD.EXP,
        Options.PIECE_SET, LJRAND2._4BLK,
        Options.RANDOMIZER, LJRAND.PURE,
        Options.HOLD_PIECE, LJHOLD.TNT,
        Options.ROTATION_SYSTEM, LJROT.SRS,
        Options.FLOOR_KICKS, 6,
        Options.LOCKDOWN, LJLOCK.STEP,
        Options.LOCK_DELAY, 30,
        Options.BOTTOM_BLOCKS, 0,
        Options.LINE_DELAY, 40,
        Options.CLEAR_GRAVITY, LJGRAV.NAIVE,
        Options.GLUING, LJGLUING.SQUARE,
        Options.SCORING, LJSCORE.TNT64,
        Options.DROP_SCORING, LJDROP.NOSCORE,
        Options.T_SPIN, LJTS.TNT,
        Options.GARBAGE, LJGARBAGE.NONE,
        Options.SIDEWAYS_DELAY, 11,
        Options.SIDEWAYS_SPEED, 5,
        Options.SOFT_DROP_SPEED, 2,
        Options.SOFT_DROP, LJZANGI.SLIDE,
        Options.HARD_DROP, LJZANGI.SLIDE,
        Options.INITIAL_SIDEWAYS, 0,
        Options.IRS, 0,
        Options.NEXT_PIECES, 3),

      /* http://www.tetrisconcept.com/forum/viewtopic.php?t=549 */
      new Preset("[TC] 40 Lines",
        Options.GIMMICK, LJGM.BTYPE,
        Options.WIDTH, 10,
        Options.PIECE_SET, LJRAND2._4BLK,
        Options.BOTTOM_BLOCKS, 0,
        Options.CLEAR_GRAVITY, LJGRAV.NAIVE,
        Options.GARBAGE, LJGARBAGE.NONE),

      /* http://www.tetrisconcept.com/forum/viewtopic.php?t=549 */
      new Preset("[TC] 180 Seconds",
        Options.GIMMICK, LJGM.ULTRA,
        Options.WIDTH, 10,
        Options.PIECE_SET, LJRAND2._4BLK,
        Options.HOLD_PIECE, LJHOLD.EMPTY,
        Options.BOTTOM_BLOCKS, 0,
        Options.CLEAR_GRAVITY, LJGRAV.NAIVE,
        Options.GLUING, LJGLUING.NONE,
        Options.SCORING, LJSCORE.LJ,
        Options.DROP_SCORING, 0,
        Options.T_SPIN, 0,
        Options.GARBAGE, LJGARBAGE.NONE),

      /* http://www.tetrisconcept.com/forum/viewtopic.php?t=892 */
      new Preset("[TC] Death 300",
        Options.GIMMICK, LJGM.ULTRA,
        Options.SPEED_CURVE, LJSPD.DEATH300,
        Options.WIDTH, 10,
        Options.HEIGHT, 20,
        Options.ENTER_ABOVE, false,
        Options.ENTRY_DELAY, 30,
        Options.PIECE_SET, LJRAND2._4BLK,
        Options.RANDOMIZER, LJRAND.HIST_6,
        Options.HOLD_PIECE, LJHOLD.EMPTY,
        Options.ROTATION_SYSTEM, LJROT.ARIKA,
        Options.FLOOR_KICKS, 0,
        Options.LOCKDOWN, LJLOCK.STEP,
        Options.LOCK_DELAY, 30,
        Options.BOTTOM_BLOCKS, 0,
        Options.LINE_DELAY, 0,
        Options.CLEAR_GRAVITY, LJGRAV.NAIVE,
        Options.GLUING, LJGLUING.STICKY,
        Options.GARBAGE, LJGARBAGE.NONE,
        Options.SIDEWAYS_DELAY, 16,
        Options.SIDEWAYS_SPEED, 1,
        Options.INITIAL_SIDEWAYS, 0,
        Options.IRS, 1,
        Options.NEXT_PIECES, 1),

      new Preset("[TC] M-Roll",
        Options.GIMMICK, LJGM.BTYPE,
        Options.SPEED_CURVE, LJSPD.DEATH300,
        Options.WIDTH, 10,
        Options.HEIGHT, 20,
        Options.ENTER_ABOVE, false,
        Options.ENTRY_DELAY, 30,
        Options.PIECE_SET, LJRAND2._4BLK,
        Options.RANDOMIZER, LJRAND.HIST_6,
        Options.HOLD_PIECE, LJHOLD.EMPTY,
        Options.ROTATION_SYSTEM, LJROT.ARIKA,
        Options.FLOOR_KICKS, 0,
        Options.LOCKDOWN, LJLOCK.STEP,
        Options.LOCK_DELAY, 30,
        Options.BOTTOM_BLOCKS, 0,
        Options.LINE_DELAY, 0,
        Options.CLEAR_GRAVITY, LJGRAV.NAIVE,
        Options.GLUING, LJGLUING.STICKY,
        Options.GARBAGE, LJGARBAGE.NONE,
        Options.SIDEWAYS_DELAY, 16,
        Options.SIDEWAYS_SPEED, 1,
        Options.INITIAL_SIDEWAYS, 0,
        Options.IRS, 1,
        Options.NEXT_PIECES, 1,
        Options.HIDE_PF, 1),

      /* http://www.tetrisconcept.com/forum/viewtopic.php?t=549 */
      new Preset("[TC] Cascade",
        Options.GIMMICK, LJGM.BTYPE,
        Options.WIDTH, 10,
        Options.PIECE_SET, LJRAND2._4BLK,
        Options.HOLD_PIECE, LJHOLD.EMPTY,
        Options.CLEAR_GRAVITY, LJGRAV.CASCADE,
        Options.GARBAGE, LJGARBAGE.NONE),

      /* http://www.tetrisconcept.com/forum/viewtopic.php?t=777 */
      new Preset("[TC] Baboo!",
        Options.GIMMICK, LJGM.BABY,
        Options.WIDTH, 10,
        Options.PIECE_SET, LJRAND2._4BLK,
        Options.SPEED_CURVE, LJSPD.ZERO,
        Options.BOTTOM_BLOCKS, 0,
        Options.CLEAR_GRAVITY, LJGRAV.NAIVE,
        Options.GLUING, LJGLUING.NONE,
        Options.SCORING, LJSCORE.LJ,
        Options.DROP_SCORING, 0,
        Options.T_SPIN, LJTS.TDS,
        Options.GARBAGE, LJGARBAGE.NONE)
    };

    Preset [] loadedPresets = predefPresets;
    int nLoadedPresets = predefPresets.length;

/*
    void presetAdd(size_t which) {
      if (which >= nLoadedPresets) {
        return;
      }
      const PresetRule *r = loadedPresets[which].rules;
      for (size_t i = 0;
           i < PRESET_MAX_RULES
           && r[i].line < Options.MENU_LEN;
           ++i) {
        presetBuffer[r[i].line] = r[i].value;
      }
    }

    void presetFinish(struct LJView *v) {
      unpackCommonOptions(v, presetBuffer);
    }
*/
}

